<template>
    <el-drawer title="验证账号" direction="rtl" size="50%" v-on:close="Load()">
        <el-form :model="form" label-width="120px">
            <div style="height: 300px">
                <el-steps direction="vertical" :active="active">
                  <el-step title="当前自身身份验证" />
                  <el-step title="当前身份是否为当事人" />
                  <el-step title="账号完成验证" />
                </el-steps>
              </div>
        </el-form>
        <el-button type="success" @click="next()">验证</el-button>
    </el-drawer>


</template>
<script setup lang="ts">
import {ref} from 'vue'
import {Vipe_Error} from '/src/style.js'
import {VerifiedLogin} from '/src/service/Login.js'
import {VerifyParty} from '/src/service/Party.js'

const params = defineProps({
  data:Object,
})


const active = ref(0)
const param = ref()


const next = () => {

    if (active.value++ > 2) active.value = 0
    //身份验证
    if(active.value == 1 && localStorage.getItem('Rola') == "2b822.2bafd1947.d194760716dc6.760716dc613b")
    {
      console.log("asd")
    }else if(active.value == 1 && localStorage.getItem('Rola') != "2b822.2bafd1947.d194760716dc6.760716dc613b")
    {
      active.value = 0
    }
    if(active.value == 2)
    {
      const data = {name:localStorage.getItem('User')}
      VerifyParty(data).then((res)=>
      {
        if(res.code !=200)
        {
          active.value = 0
        }
        if(res.code == 200)
        {
          param.value = res.code
        }
      })
    }
    if(active.value == 3 && param.value == 200)
    {
      const data = {User:params.data.login_user,Password:params.data.login_password}
      VerifiedLogin(data)
    }
  }

</script>
<style></style>